package cn.hahah.module.blog.dal.mysql.sysnotice;

import java.util.*;

import cn.hahah.framework.common.pojo.PageResult;
import cn.hahah.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hahah.framework.mybatis.core.mapper.BaseMapperX;
import cn.hahah.module.blog.dal.dataobject.sysnotice.SysNoticeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.hahah.module.blog.controller.admin.sysnotice.vo.*;

/**
 * 博客系统公告 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SysNoticeMapper extends BaseMapperX<SysNoticeDO> {

    default PageResult<SysNoticeDO> selectPage(SysNoticePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SysNoticeDO>()
                .eqIfPresent(SysNoticeDO::getTitle, reqVO.getTitle())
                .eqIfPresent(SysNoticeDO::getContent, reqVO.getContent())
                .betweenIfPresent(SysNoticeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SysNoticeDO::getId));
    }

}